package com.solve.controller;

import com.github.pagehelper.PageInfo;
import com.solve.entity.ResourceClassification;
import com.solve.entity.base.BaseResponse;
import com.solve.service.impl.ResourceClassificationServiceImpl;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/resrourceClassification")
public class ResrourceClassificationController {
    @Resource
    private ResourceClassificationServiceImpl resourceClassificationService;

    @GetMapping("/selectResourceClassification")
    public BaseResponse selectResourceClassification(ResourceClassification resourceClassification){

        BaseResponse baseResponse = new BaseResponse();
        try{
           PageInfo  pageInfo =  resourceClassificationService.selectResourceClassification(resourceClassification);
           baseResponse.setData(pageInfo);
           baseResponse.setSuccess(true);
           baseResponse.setMsg("查询成功!");
        }catch (Exception e){
            e.printStackTrace();
            baseResponse.setData("");
            baseResponse.setSuccess(true);
            baseResponse.setMsg("查询失败!");
        }
        return baseResponse;
    }

}
